<div class="album " ui-view="container">

    <div class="head_title">
        <span class="news">专辑管理</span>
    </div>

    <div class="content-margin wp-20 padding-10">
        <input type="button" value="新建专辑" class="btn-primary btn" ui-sref="main.album.create">

    </div>


    <div class="content-margin">
        <uib-tabset active="search.reviewStatus" ng-if="$state.current.name=='main.album'">
            <uib-tab index="'0'" heading="全部({{countMessage.albumCount}})"  ng-click="statusClick('0')"></uib-tab>
            <uib-tab index="'7'" heading="待审核({{countMessage.albumWaitCount}})" ng-click="statusClick('7')"></uib-tab>
            <uib-tab index="'8'" heading="已通过({{countMessage.albumAdoptCount}})" ng-click="statusClick('8')" ></uib-tab>
            <uib-tab index="'9'" heading="未通过({{countMessage.albumNotAdoptCount}})" ng-click="statusClick('9')"></uib-tab>

            <div class=" pull-right" style="width: 250px" style="padding-right: 0px">
                <div class="input-group input-group-sm" >
                    <input type="text" class="form-control" name="keyword" ng-model="keyword" placeholder="专辑名称/专辑ID"  ui-event="{ keyup : 'keyup($event,keyword)' }">
						<span class="input-group-btn btn-bearch">
							<button class="btn btn-default" type="button" ng-click="searchClick(keyword)">
                                <i class="glyphicon glyphicon-search"></i>
                            </button>
						</span>
                </div>
            </div>
        </uib-tabset>
        <div class="wp-20">
            <table class="table table-bordered table-hover ">

                <tbody>
                <tr ng-repeat="album in albums">

                    <td style="width: 120px;cursor: pointer;padding-left: 20px" ui-sref="main.album.info({albumId:album.albumId,pageNo:1,pageSize:10,reviewStatus:null,keyword:null})">
                        <img ng-src="{{album.albumCover}}" style="width: 100px;height: 100px">
                    </td>
                    <td class="album-info" ui-sref="main.album.info({albumId:album.albumId,pageNo:1,pageSize:10,reviewStatus:null,keyword:null})" style="cursor: pointer">
                        <div class=" max_td"><label>专辑ID :</label>{{album.albumId}}</div>
                        <div class=" max_td"><label >名称 :</label>{{album.albumName}}</div>
                        <div><label>时长 :</label>{{album.duration}}</div>
                        <div ng-class="{'red':album.reviewStatus==9,'greed':album.reviewStatus==8,'yellow':album.reviewStatus==7}"><label style="color: #333;">状态 :</label>{{table[album.reviewStatus]}} <span  ng-if="album.reviewStatus==9">（{{table[album.reviewErrorId]}}）</span></div>
                    </td>
                    <td  class="align-bottom">
                        <a class="circle" ng-click="uploadProgram(album.albumId)">上传</a>
                        <a class="circle" ui-sref="main.album.info({albumId:album.albumId,pageNo:1,pageSize:10,reviewStatus:null,keyword:null})">节目管理</a>
                        <a class="circle" ui-sref="main.album.edit({albumId:album.albumId})" ng-if="album.reviewStatus==7||album.reviewStatus==9">编辑</a>
                        <a class="not-circle circle"  ng-if="album.reviewStatus==8">编辑</a>
                        <a class="circle" ui-sref="main.album.detail({albumId:album.albumId})">详情</a>
                        <a class="circle" ng-style="album.myObj" ng-click="delete(album)" ng-if="album.reviewStatus==7||album.reviewStatus==9">删除</a>
                        <a class="not-circle circle" ng-if="album.reviewStatus==8">删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="panel-footer">
                <s-pagination conf="paginationConf"></s-pagination>
            </div>

        </div>


    </div>
    <script type="text/ng-template" id="programUpload.html">
        <div class="modal-header">
            <button type="button" class="close" ng-click="cancel()"><span>&times;</span></button>
            <span class="modal-title">批量上传(最多一次传20条音频)</span>
        </div>
        <div class="modal-body reset-password">

            <div class="label-div radio-inline"style="padding-left: 0px" >
                <div class="a-upload btn btn-primary" style="height: 28px;float: left;margin-bottom: 10px">
                    <input type="file"  nv-file-select uploader="uploaderAudio" class="form-control mw-300" multiple >
                    选择
                </div>
                <div style="font-size: 12px" ng-if="image_a==true"  class="emailError">
                    {{imageMsg}}
                </div>
            </div>
            <div ng-if="uploaderAudio.queue.length>0" style="max-height: 300px;overflow-y: auto">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>音频名称</th>
                        <th>大小</th>
                        <th>进度</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in uploaderAudio.queue" ng-class="{'red':item.isSuccess=='uploadFail'}">
                        <td><span ng-show="item.isSuccess=='uploadFail'">(上传失败)</span><span class="first-td">{{item.file.name}}</span></td>
                        <td>{{ item.file.size/1024/1024|number:2 }} MB</td>
                        <td>
                            <uib-progressbar value="item.progress">{{item.progress}}%</uib-progressbar>

                        </td>
                        <td><i class="fa fa-trash" aria-hidden="true" style="color: red"
                               ng-click="item.remove();removeFile($index,item)"></i>
                        </td>
                    </tr>
                    </tbody>
                </table>

            </div>
            <div class="label-div radio-inline" ng-if="uploaderAudio.queue.length>0" style="padding-left: 0px">
                <div class="a-upload btn btn-primary" style="height: 28px;float: left;margin-bottom: 10px;margin-top: 13px" ng-click="uploadAllAudio()">
                    上传
                </div>

                <br>
                <span style="margin-top: 10px" ng-show="uploaderAudio.queue.length">已选择{{uploaderAudio.queue.length}}条</span>

            </div>

        </div>
        <div style="text-align: center;color: red">
            {{message}}
        </div>
        <div class="modal-footer" style="border-top: 1px solid #e5e5e5">
            <button class="btn btn-primary" type="button" ng-click="ok()" ng-show="uploaderAudio.queue.length==list.length" ng-disabled="disabled">{{'确定'}}</button>
            <button class="btn btn-primary" type="button" ng-show="uploaderAudio.queue.length!=list.length">{{'等待上传完成'}}</button>
            <button class="btn ims-btn" type="button" ng-click="cancel()">{{'取消'}}</button>
        </div>

    </script>


    <!--<a ui-sref="campaigns.detail({campaignsId:1})"  ui-sref-opts="{inherit:false}">aaaaa</a>-->
</div>
